package com.chuyangc.controller;

import com.chuyangc.entity.Order;
import com.chuyangc.service.OrderService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author 欧楚杨
 */
@RestController
@RequestMapping("order")
public class OrderController {
    private final OrderService orderService;

    OrderController(OrderService orderService){
        this.orderService = orderService;
    }

    @GetMapping("selectAll")
    public List<Order> selectAll(){
        return orderService.list();
    }
}
